package com.example.demo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author gxing
 * @desc TODO
 * @date 2023/11/17
 */
public class ForEachDemo {

    public static void main(String[] args) {
        List<String> list1 = new ArrayList<>(Arrays.asList("a", "b", "c"));

        list1.forEach(e -> {

            if (!e.equals("a")) {
                System.out.println("return");
                return;
            }
            System.out.println(e);
        });
    }
}
